class Task < ActiveRecord::Base
  # attr_accessible :title, :started_on, :completed_on, :description_html, :description_markdown, :sub_contractor_id, :status_code, :milestone_id
  
  belongs_to  :milestone
  belongs_to  :sub_contractor
  has_many    :tags, :as => :taggable
  
  before_save   :markup_description, :if => Proc.new { |b| b.description_markdown_changed? }
  
  def markup_description
    self.description_html = BlueCloth::new(self.description_markdown).to_html
  end
end
